const arrayToFlat = (arr: (object | [object])[]) => {
  const result: unknown[] = [];
  arr?.forEach((item) => {
    if (Array.isArray(item)) {
      result.push(...item);
    } else {
      result.push(item);
    }
  });
  console.log(arr, result);

  return result;
};

export default arrayToFlat;
